package ptb1;

import java.io.*;
import java.util.Scanner;
public class PTB1 {
                public static void main(String[] args) throws Exception {
                                Scanner kb=new Scanner(System.in);
                                System.out.println("Giai phuong trinh bac nhat dang ax+b=0");
                                System.out.print("Nhap he so a: ");
                                double a = kb.nextDouble();
                                System.out.print("Nhap he so b: ");
                                double b = kb.nextDouble();
                                if(a==0) {
                                                if(b==0) System.out.println("Phuong trinh vo so nghiem");
                                                if(b!=0) System.out.println("Phuong trinh vo dinh");
                                }
                                else System.out.println("Phuong trinh mot nghiem x=" + -b/a);
                }
}